---
title: "Replication Materials for 'Administrative Records Mask Racially Biased Policing'"
author: "Dean Knox, Will Lowe, and Jonathan Mummolo"
date: "9/12/2019"
output: html_document
---

### Contents

---------------------------------------------------------------------------------
File                                 Purpose
------------------------------------ --------------------------------------------
 `create_data/build_fryer_sqf_jm.R`  Script to clean and collate raw SQF data

 `create_data/raw/20{03-13}.csv`     Raw data SQF data files for 2003-2013      
                   
 `data/sqf_fryer_2003_2013.Rdata`    Processed SQF data for models
 
 `data/FryerNDAppTable3Coefs.csv`    Fryer (forthcoming) Table 3 coefficients
 
 `data/GelmanFaganKissTable1.csv`    Gelman et al. 2007 Table 1
 
 `bounds_20190120.R`                 Simulations for base and full models

 `bounds_20190120_blackwhite.R` 
 
 `bounds_20190120_hispwhite.R`  
 
 `bounds_20190120_nodrugs.R`    
 
 `data_dropping_comparison.R`   
 
 `plots.R`                           Paper plots and table (see Output below)
 
 `plots_blackwhite.R`
 
 `plots_hispwhite.R`
 
 `plots_nodrugs.R`
----------------------------------------------------------------------------


### Output

---------------------------------------------------------------------------------
File                                             Table
------------------------------------------------ --------------------------------
 `tables/table1_black.tex`                       Table 1 (upper)

 `tables/table1_hispanic.tex`                    Table 1 (lower)
---------------------------------------------------------------------------------


---------------------------------------------------------------------------------
File                                             Figure
------------------------------------------------ --------------------------------
 `pics/bounds_hands_correct.pdf`                 Fig 4
 
 `pics/proportion_missed.pdf`                    Fig 5

 `pics/replication_black.pdf`                    Supplement B1 (upper)

 `pics/replication_hispanic.pdf`                 Supplement B1 (lower)

 `pics/bounds_other_correct_base_black.pdf`      Supplement B2 (upper)

 `pics/bounds_other_correct_full_black.pdf`      Supplement B2 (lower)

 `pics/bounds_other_correct_base_hispanic.pdf`   Supplement B3 (upper)

 `pics/bounds_other_correct_full_hispanic.pdf`   Supplement B3 (lower)

 `pics/bounds_hands_correct_nodrug.pdf`          Supplement B4

 `pics/bounds_hands_correct_blackwhite.pdf`      B5 (upper)

 `pics/bounds_hands_correct_hispwhite.pdf`       B5 (lower)
--------------------------------------------------------------------------------



### Intermediate calculations

Bounds calculations create and plot code uses files in `intermediate_files/` directory.

### Replication

To replicate the figures, first ensure that you have installed the files in 
`libraries.txt`. Then source the following files in order

* `bounds_20190120.R`                 
* `bounds_20190120_blackwhite.R` 
* `bounds_20190120_hispwhite.R`  
* `bounds_20190120_nodrugs.R`    
* `data_dropping_comparison.R`   
* `plots.R`
* `plots_blackwhite.R`
* `plots_hispwhite.R`
* `plots_nodrugs.R`

This will populate the `pics/` and `tables/` folder.

Removing the files in `intermediate_files/` will trigger bounds recompilation. 
Please note that running `bounds_20190120.R` will take substantial time and 
resources.

